import csv

def write_curve_to_csv(x_name, y_name, x_array, y_array, file_name):
    with open(file_name, 'w') as f:
        writer = csv.writer(f)
        writer.writerow([x_name, y_name])
        for i in range(len(x_array)):
            writer.writerow([x_array[i], y_array[i]])